//package cn.school.web;
//
//import cn.school.entity.Page2;
//import cn.school.entity.Student;
//import cn.school.service.StudentService;
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.serializer.SerializerFeature;
//
//import javax.servlet.ServletException;
//import javax.servlet.annotation.WebServlet;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//
////前后端分离开发
//
//@WebServlet(name = "StudentServlet",value = "/studentAjaxServlet")
//public class StudentServlet extends HttpServlet {
//    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//
//    }
//    StudentService service=new StudentService();
//    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//
//
//        int pageNo=1;
//        try{
//            pageNo=Integer.parseInt(request.getParameter("pageNo"));
//        }catch(Exception e){}
//        String name=request.getParameter("sname");
//        name=name==null?"":name;
//        String tel=request.getParameter("tel");
//        tel=tel==null?"":tel;
//
//        Page2<Student> p=service.search(pageNo, StudentService.PAGE_SIZE, name, tel, null, null);
//
//        response.setContentType("application/json;charset=utf-8");
//        String str= JSON.toJSONStringWithDateFormat(p,"yyyy-MM-dd",SerializerFeature.WriteMapNullValue,
//                SerializerFeature.WriteDateUseDateFormat);//, SerializerFeature.UseISO8601DateFormat);
//        response.getWriter().print(str);
//    }
//}
